package com.yt.sys.service;

import com.yt.sys.models.vo.SysRoleVO;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.sys.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.sys.mapper.SysRoleMapper;
import com.yt.sys.models.service.ISysRoleService;
import com.yt.sys.models.bo.SysRoleSaveBO;
import com.yt.sys.models.dto.SysRoleDTO;

import java.util.Collections;
import java.util.List;

/**
 * 角色详情控制器
 *
 * @author thekai
 * @Date 2025-10-23 11:32:41
 */
@DubboService
public  class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRoleDTO> implements ISysRoleService{

    @Resource
    private YmlConfig ymlConfig;
    @Resource
    private SysRoleMapper sysRoleMapper;

    @Override
    public boolean add(SysRoleSaveBO saveBO) {
        SysRoleDTO dto = new SysRoleDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
    @Override
    public List<SysRoleVO> query() {
        List<SysRoleVO> sysRoleVOS = sysRoleMapper.query();
        return sysRoleVOS;
    }

    @Override
    public boolean roleAdd(SysRoleSaveBO saveBO) {
        return false;
    }

    @Override
    public List<SysRoleVO> queryRole() {
        return Collections.emptyList();
    }
}
